package top.yueyazhui.vhr.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.yueyazhui.vhr.mapper.FileMapper;
import top.yueyazhui.vhr.model.File;

@Service
public class FileService {

    @Autowired
    FileMapper fileMapper;

    public Integer insert(File file) {
        int result = fileMapper.insertSelective(file);
        if(result == 1) {
            return file.getId();
        }
        return 0;
    }

    public File getByUrl(String url) {
        return fileMapper.getByUrl(url);
    }
}
